﻿using System.Web.Mvc;
using Contracts.Service;

namespace AOP.Controllers
{
    public class HomeController : Controller
    {
        private readonly IWriteOutput _writeOutput;

        public HomeController(IWriteOutput writeOutput)
        {
            _writeOutput = writeOutput;
        }

        public ActionResult Index()
        {
            _writeOutput.WriteTheOutput("home");
            _writeOutput.ThrowMeAnException();
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}